package cn.com.lms.business.cc.service;

import cn.com.lms.business.cc.persistence.entity.ExamExercise;
import cn.com.lms.business.cc.persistence.repository.CCExerciseDao;
import cn.com.lms.business.cc.vo.ExamExerciseVO;
import cn.com.lms.business.examRewrite.persistence.entity.ExerciseReWrite;
import cn.com.lms.business.examRewrite.persistence.entity.ExerciseReWriteVo;
import cn.com.lms.business.examRewrite.persistence.repository.ExerciseReWriteDao;
import com.bnzj.core.persistence.BaseService;
import com.bnzj.core.persistence.query.QueryHelpBean;
import org.springframework.stereotype.Service;


@Service
public class CCExerciseService extends BaseService<CCExerciseDao, ExamExercise, Long> {


    public static QueryHelpBean getQueryHelpBean() {
        String baseSQL = "SELECT ee.*,(SELECT count(*) FROM bnz_exam_question_subject WHERE is_delete = 0 AND question_id" +
                " IN " +
                "(SELECT question_id FROM bnz_exam_exercise_question eq  WHERE ee.id = eq.exercise_id)) count";
        String whereSQL = " from bnz_exam_exercise ee where 1=1 ";
        QueryHelpBean queryHelpBean = new QueryHelpBean(baseSQL+whereSQL,"select count(1)" + whereSQL, ExamExerciseVO.class);
        return queryHelpBean;
    }


}
